import request from "../http/http"
const isLoggedIn = localStorage.getItem('token');

//新增出车记录
export const addChuche = (category) => {
    console.log(category,'调用了添加接口')
    return request.post('/admin/addrecord', category,{
        headers:{
            Token:isLoggedIn
        }
    });
};

//查询出车记录列表
export const getChucheList = (count,data) => {
    return request.get('/admin/getrecords', {
        params:{
            page:count,
            size:50,
            endDate:data.endDate,
            startDate:data.startDate,
            fanhuiStartDate:data.fanhuiStartDate,
            fanhuiEndDate:data.fanhuiEndDate
        },
        headers:{
            Token:isLoggedIn
        }
    });
};

//删除出车记录
export const deleteChuche = (id) => {
    console.log('出车记录',id)
    return request.delete(`/admin/deleterecord/${id}`,{
        headers:{
            Token:isLoggedIn
        }
    });s
};

// 修改出车记录
export const putChuche = (data) => {
    console.log(data,'调用了修改接口')
    return request.put('/admin/updaterecord', data,{
        headers:{
            Token:isLoggedIn
        }
    });
};